package com.hd.pzhwlxt.controller.model1;

import com.hd.pzhwlxt.pojo.Department;
import com.hd.pzhwlxt.service.DepartmentService;
import com.hd.pzhwlxt.utils.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @create: 2022-09-24 15:23
 * @author: 怀念天空
 * @Description:
 */
@RestController
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/dept")
    public Response<Object> getAllDept(){
        List<Department> list = departmentService.list();
        return Response.createSuccessResponse(list);
    }
}
